package com.pig4cloud.pigx.wxApi.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.pigx.wxApi.entity.RegisterBean;
import com.pig4cloud.pigx.wxApi.entity.SysUserInfo;

import java.util.List;

/**
 * <p>
 * 用户信息表 服务类
 * </p>
 *
 * @author dhing
 * @since 2020-12-29
 */

public interface UserInfoService extends IService<SysUserInfo> {
	
	boolean mobileExsit(String mobile);

	boolean emailExsit(String email);

	boolean userNameExsit(String userName);

	boolean registerExt(RegisterBean registerBean);
	
	boolean register(String moible, String password);

	SysUserInfo getUserByPhoneAndPassword(String phone, String password);

	SysUserInfo getUserByEmailAndPassword(String email, String password);

	SysUserInfo getUserByEmail(String email);
	
	SysUserInfo getUserByPhone(String phone);

	SysUserInfo getUserByUserName(String userName);
	
	SysUserInfo getUserByUserId(Long userId);

	SysUserInfo getUserByOpenId(String openId);
	
	boolean updatePassword(String mobile, String password);

	boolean updatePasswordByUserId(Long userId, String password);

	boolean updateMobile(String oldMobile, String newMobile);

	int addCollect(Long id);

	int reduceCollect(Long id);


	public List<SysUserInfo> getALlUsers();

	SysUserInfo saveWeChatUser(String code);

	SysUserInfo bandingWechat(String code, String state);

	int addViews(Long id);

	int updateUserInfo(SysUserInfo userInfo);

	Long findUserByPhoneOrNameOrEmail(String username);

}
